package com.lyfei.yd.common.enums;

import lombok.Getter;

@Getter
public enum ErrorCode {
    
    // 用户模块错误码
    USER_NOT_EXIST(1001, "用户不存在"),
    USER_ALREADY_EXIST(1002, "用户已存在"),
    USER_PASSWORD_NOT_MATCH(1003, "用户名或密码错误"),
    USER_ACCOUNT_ERROR(1004, "用户账号错误"),
    USER_ACCOUNT_FORBIDDEN(1005, "用户账号已被禁用"),
    USER_ACCOUNT_LOCKED(1006, "用户账号已被锁定"),
    USER_ACCOUNT_EXPIRED(1007, "用户账号已过期"),
    USER_CREDENTIALS_EXPIRED(1008, "用户认证信息已过期"),
    USER_NOT_LOGIN(1009, "用户未登录"),

    CAPTCHA_ERROR(2001, "图形验证码错误"),

    INVALID_PARAM(3001, "参数不合法"),

    GOODS_NOT_EXIST(4001, "商品不存在, 可能已下架"),
    GOODS_NO_STOCK(4002, "库存不足"),
    CART_GOODS_NOT_EXIST(4003, "购物车商品不存在");

    private final Integer code;
    private final String msg;

    private ErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
